<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>宅鱼</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="google-site-verification" content="yH7MwnMb7LXru16F4FAfY94pn-oZLhF8Szu4PuL7Oxw" />
  <meta name="description" content="前端，技术，博客，记录，javascript，html5，css">
<meta property="og:type" content="website">
<meta property="og:title" content="宅鱼">
<meta property="og:url" content="http://ikkkr.com/page/12/index.html">
<meta property="og:site_name" content="宅鱼">
<meta property="og:description" content="前端，技术，博客，记录，javascript，html5，css">
<meta property="og:locale" content="default">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="宅鱼">
<meta name="twitter:description" content="前端，技术，博客，记录，javascript，html5，css">
  
    <link rel="alternative" href="/atom.xml" title="宅鱼" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.ico"  type="image/x-ico">
   
  <link rel="stylesheet" href="/css/style.css">
  

</head>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">宅鱼</a>
      </h1>
      
        <h2 id="subtitle-wrap">
          <a href="/" id="subtitle">部落格</a>
        </h2>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">首页</a>
        
          <a class="main-nav-link" href="/archives">文章</a>
        
          <a class="main-nav-link" href="/raincss">RainCSS</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://ikkkr.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main">
  
    <article id="post-e5-b1-80-e9-83-a8-e5-8f-98-e9-87-8f-e4-b8-8e-e5-85-a8-e5-b1-80-e5-8f-98-e9-87-8f-local-variable-and-global-variable" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2010/10/23/e5-b1-80-e9-83-a8-e5-8f-98-e9-87-8f-e4-b8-8e-e5-85-a8-e5-b1-80-e5-8f-98-e9-87-8f-local-variable-and-global-variable/" class="article-date">
  <time datetime="2010-10-23T02:44:19.000Z" itemprop="datePublished">2010-10-23</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/web-development/">web development</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2010/10/23/e5-b1-80-e9-83-a8-e5-8f-98-e9-87-8f-e4-b8-8e-e5-85-a8-e5-b1-80-e5-8f-98-e9-87-8f-local-variable-and-global-variable/">局部变量与全局变量_Local variable and Global variable</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>有几个问题：</p>
<p>1.局部变量和全局变量存在于内存的哪个区域？</p>
<p>2.局部变量和全局变量在什么时候被初始化？</p>
<p>3.局部变量真的比全局变量更加好用吗？</p>
<p>4.java与javascript上局部变量与全局变量有什么区别?</p>
<p>下面是个人的研究结果…</p>
<h4 id="1-局部变量和全局变量存在于内存的哪个区域？"><a href="#1-局部变量和全局变量存在于内存的哪个区域？" class="headerlink" title="1.局部变量和全局变量存在于内存的哪个区域？"></a>1.局部变量和全局变量存在于内存的哪个区域？</h4><p>java全局变量和静态变量存储在堆里的静态存储区里；而局部变量存在于栈里。JavaScript没有资料特别提到，而其似乎也类似java：</p>
<p>局部变量：    栈区</p>
<p>局部静态变量：静态区</p>
<p>全局变量：    静态区的常量区</p>
<p>全局静态变量：静态区</p>
<p>注:java内存分为:stack segment  、heap segment、code segment 、data segment(静态区)</p>
<p>code segment即方法区：</p>
<p>方法区存放装载的类数据信息包括：</p>
<p>（1）：基本信息：</p>
<p>1）每个类的全限定名</p>
<p>2）每个类的直接超类的全限定名(可约束类型转换)</p>
<p>3）该类是类还是接口</p>
<p>4）该类型的访问修饰符</p>
<p>5）直接超接口的全限定名的有序列表</p>
<p>（2）：每个已装载类的详细信息</p>
<p>Java 栈内存以帧的形式存放本地方法的调用状态(包括方法调用的参数，局部变量，中间结果等)。每调用一个方法就将对应该方法的方法帧压入Java 栈，成为当前方法帧。当调用结束(返回)时，就弹出该帧。</p>
<p>全局变量和静态变量的区别：</p>
<p>全局变量在整个工程文件内都有效；静态全局变量只在定义它的文件内有效；静态局部变量只在定义它的函数内有效，只是程序仅分配一次内存，函数返回后，该变 量不会消失；局部变量在定义它的函数内有效，但是函数返回后失效。全局变量(外部变量)的说明之前再冠以static 就构成了静态的全局变量。</p>
<p>而javascript和java有许多类似的地方,原始类型的引用被存放在栈中，如Undefined ,Null ,Bollean ,String,而对其他对象等的引用则存放到堆内存中。</p>
<p>而其中有个很大的区别就是java和js在同名变量的使用上存在区别：</p>
<p>js:</p>
<p>var a = 100;</p>
<p>function testResult(){</p>
<p>var b = 2 * a;//函数范围内不会自动查找全局变量</p>
<p>var a = 200;</p>
<p>var c = a / 2;//调用新声明的局部变量a</p>
<p>alert(b);//结果为NaN</p>
<p>alert(c);//结果为100</p>
<p>}</p>
<p>java:</p>
<p>int a = 100;</p>
<p>public int testResult() {</p>
<p>int b = 2 * a;//使用全局变量a</p>
<p>System.out.println(b);//结果为200</p>
<p>int a = 200;</p>
<p>int c = a / 2;//使用已经声明的</p>
<p>System.out.println(c);//结果为100</p>
<p>return c;</p>
<p>}</p>
<p><strong>2.局部变量和全局变量在什么时候被初始化？</strong></p>
<p>java中静态变量在类加载之前进行初始化，而类属性变量(类中的全局变量)，在类实例被创建进行初始化，而方法中的局部变量则在此时进行初始化，不同的是必须明确进行赋值，jvm不会对其进行默认赋值。</p>
<p>js在html页面被加载的同时被加载，其执行环境被创建，环境中的全局变量被初始化，若没有进行赋值则给其设置默认值undefined，局部函数里面同样进行这种处理。不同的是：java会要求局部变量设置初始值，而js则无此要求。</p>
<p><strong>3.局部变量真的比全局变量更加好用吗？</strong></p>
<p>几乎所有的文章都在说一句话，局部变量访问速度比全局变量快？具体原因很少有人问及。我来举个例子细说一下：</p>
<p>var a = 3;</p>
<p>function test(){</p>
<p>var b = a;</p>
<p>alert(b); //结果为undefined</p>
<p>var a = 5;</p>
<p>alert(a);//结果为5</p>
<p>}</p>
<p>细想一下b根本无法被访问，何来访问速度快慢之说？再看：</p>
<p>var a = 3;</p>
<p>function test2(){</p>
<p>var b = 5;</p>
<p>var c  = a+1;</p>
<p>var d = b+1;</p>
<p>alert(c);//结果为4</p>
<p>alert(d);//结果为6</p>
<p>}</p>
<p>此时d的运算速度快于c，这也许是访问快慢的关键所在。</p>
<p>**</p>
<p>4.java与javascript上局部变量与全局变量有什么区别?**</p>
<p>在java中全局变量有整个环境范围内与类范围内的区别，整个环境范围的变量用静态变量来实现。而js中全局变量则是该页面window对象下的环境变量，无法跨页面共享。</p>
<p>局部变量则类似，唯一区别是java强制要求赋值，而js不要求。</p>

      
    </div>
    <footer class="article-footer">
<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_fbook" data-cmd="fbook" title="分享到Facebook"></a><a href="#" class="bds_linkedin" data-cmd="linkedin" title="分享到linkedin"></a><a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/java/">java</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/javascript/">javascript</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/语言/">语言</a></li></ul>

    </footer>
  </div>
  


</article>
  
    <article id="post-java-e4-b8-ad-e7-9a-84-e6-95-b0-e6-8d-ae-e5-92-8c-e5-af-b9-e8-b1-a1-e7-9a-84-e5-ad-98-e5-82-a8-e6-9c-ba-e5-88-b6-e7-9a-84-e4-b8-80-e7-82-b9-e7-90-86-e8-a7-a3" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2010/09/10/java-e4-b8-ad-e7-9a-84-e6-95-b0-e6-8d-ae-e5-92-8c-e5-af-b9-e8-b1-a1-e7-9a-84-e5-ad-98-e5-82-a8-e6-9c-ba-e5-88-b6-e7-9a-84-e4-b8-80-e7-82-b9-e7-90-86-e8-a7-a3/" class="article-date">
  <time datetime="2010-09-10T02:37:13.000Z" itemprop="datePublished">2010-09-10</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/java-web/">java web</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2010/09/10/java-e4-b8-ad-e7-9a-84-e6-95-b0-e6-8d-ae-e5-92-8c-e5-af-b9-e8-b1-a1-e7-9a-84-e5-ad-98-e5-82-a8-e6-9c-ba-e5-88-b6-e7-9a-84-e4-b8-80-e7-82-b9-e7-90-86-e8-a7-a3/">java中的数据和对象的存储机制的一点理解</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>《think in java》讲到我们的java中创建的数据和对象存放的位置，具体如下:</p>
<p>(1) 寄存器。 即cpu内部，无法控制。CPU对存储器中的数据进行处理时，往往先把数据取到内部寄存器中，而后再作处理。</p>
<p>(2) 堆栈。(RAM)这个应该类似与数据结构的栈，可以实现快速存取，这里存放对象实例的句柄，以及基本类型的变量（,int, short, long, byte, float, double, boolean, char），且栈数据可以共享。</p>
<p>(3) 堆。(RAM)运行时数据区，动态分配内存空间，用于存放new 创建的java对象实例。</p>
<p>(4)  静态存储。这儿的“静态”（Static）静态变量必定存放在此区域，且在程序运行结束，由java自动回收(其在类加载时进行初始化，且所有对象实例进 行共享使用)。另一个是全局变量，C/C++中似乎它们在同一个内存区域，但java中全局变量似乎在堆栈中，具体待求证？</p>
<p>(5) 常数存储。常数值通常直接置于程序代码内部。（ROM）。程序结束后由系统释放 ?</p>
<p>(6) 非RAM存储。书中讲到的“流式对象”和“固定对象”。前者是服务器之间数据传递，后者属于将数据对象存储到硬盘中。<br>示例:<br>public class Test {</p>
<p>//–栈–栈<br>//这里的3在栈里面被共享<br>int a = 3;</p>
<p>//–栈–栈<br>int b = 3;</p>
<p>//——栈——栈<br>String hello = “hello”;</p>
<p>//—-栈–堆<br>Pager p = new Pager();</p>
<p>//堆(静态存储空间?)<br>static int c;</p>
<p>//ROM<br>static final int NUMBER = 0;<br>}</p>

      
    </div>
    <footer class="article-footer">
<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_fbook" data-cmd="fbook" title="分享到Facebook"></a><a href="#" class="bds_linkedin" data-cmd="linkedin" title="分享到linkedin"></a><a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/java/">java</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/语言/">语言</a></li></ul>

    </footer>
  </div>
  


</article>
  
    <article id="post-java-e4-b8-ad-e7-9a-84-e5-8f-a5-e6-9f-84-e4-b8-8e-e5-af-b9-e8-b1-a1-handler-and-object-in-java" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2010/09/05/java-e4-b8-ad-e7-9a-84-e5-8f-a5-e6-9f-84-e4-b8-8e-e5-af-b9-e8-b1-a1-handler-and-object-in-java/" class="article-date">
  <time datetime="2010-09-05T02:31:21.000Z" itemprop="datePublished">2010-09-05</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/java-web/">java web</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2010/09/05/java-e4-b8-ad-e7-9a-84-e5-8f-a5-e6-9f-84-e4-b8-8e-e5-af-b9-e8-b1-a1-handler-and-object-in-java/">java中的句柄与对象_Handler and object in java</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>java中的句柄和c++中的句柄在作用上我认为完全相同:引用对象的唯一标识,或者说是一个标识符，是拿来标识对象或者项目的。而在c++当中似乎讲到  句柄是一种指向指针的指针。而java中已经没有”指针”这个概念?</p>
<p>java中，人们更倾向与将句柄认为是一个对对象的”引用”，当然更可以把它类比”指针”，事实上《think in   java》里面就是这么讲的，深入理解起来的话，这样讲也没有问题，但深入理解起来的话就有点让人模糊了。什么是引用？怎么实现的？</p>
<p>这里我借用c++里面的思维很容易进行理解：</p>
<p>句柄地址(稳定)→记载着对象在内存中的地址————→对象在内存中的地址(不稳定)→实际对象</p>
<p>实际中的代码也可以看出这一点：</p>
<p>Pager a = new Pager();<br>Pager b;<br>System.out.println(new Pager());<br>System.out.println(a);</p>
<p>结果：<br>com.webmachine.model.Pager@5224ee<br>com.webmachine.model.Pager@f6a746<br>可以看出这两行打印出了对象的地址，不同的是一个使用的是对象句柄。 所以这句代码确切的解释应该是：<br>Pager a//创建句柄<br>Pager a = //句柄引用<br>new Pager();//创建对象实例<br>Pager a = new Pager();//句柄引用对象实例</p>
<p>由此我认为《think in java》中讲到句柄操控对象(C++中我不能确定)，这个说法非常不确切。应该强调的是 句柄操控对象实例，简而言之：对象被创建，实例被引用。</p>

      
    </div>
    <footer class="article-footer">
<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_fbook" data-cmd="fbook" title="分享到Facebook"></a><a href="#" class="bds_linkedin" data-cmd="linkedin" title="分享到linkedin"></a><a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/java/">java</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/语言/">语言</a></li></ul>

    </footer>
  </div>
  


</article>
  
    <article id="post-java-e4-b8-ad-e7-9a-84-e4-b8-8a-e4-b8-8b-e6-96-87-e4-b8-8ejavascript-e4-b8-ad-e7-9a-84-e4-b8-8a-e4-b8-8b-e6-96-87-e5-88-86-e6-9e-90-context-in-java-and-javascript" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2010/08/29/java-e4-b8-ad-e7-9a-84-e4-b8-8a-e4-b8-8b-e6-96-87-e4-b8-8ejavascript-e4-b8-ad-e7-9a-84-e4-b8-8a-e4-b8-8b-e6-96-87-e5-88-86-e6-9e-90-context-in-java-and-javascript/" class="article-date">
  <time datetime="2010-08-29T02:28:41.000Z" itemprop="datePublished">2010-08-29</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/web-development/">web development</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2010/08/29/java-e4-b8-ad-e7-9a-84-e4-b8-8a-e4-b8-8b-e6-96-87-e4-b8-8ejavascript-e4-b8-ad-e7-9a-84-e4-b8-8a-e4-b8-8b-e6-96-87-e5-88-86-e6-9e-90-context-in-java-and-javascript/">java中的上下文与javascript中的上下文分析_Context in java And javascript</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>context一词在计算机术语中被意为上下文，但我觉得要理解它还不如用其本来的意义：背景, 环境, （事情发生的）背景。因为就上下文这个词很难将事实准确的描述,下面是我对其在java和javascript中的一点分析。</p>
<p>在java中Context是一个接口，他表示一个命名环境，并由一组名字到对象的绑定组成，它包含方法检查并更新这些绑定。原文如下:<br>This interface represents a naming context, which  consists of a set of  name-to-object bindings.  It contains methods for examining and updating  these bindings.<br>原文链接：<a href="http://download.oracle.com/javase/1.4.2/docs/api/javax/naming/Context.html" target="_blank" rel="noopener">http://download.oracle.com/javase/1.4.2/docs/api/javax/naming/Context.html</a><br>或则说用其来构造一个应用运行的环境，有了环境，程序才能在环境中运作。</p>
<p>而servlet中的context则是另一个说法：</p>
<p>ServletContext接口定义了一个Servlet环境对象，这个对象定义了一个在Servlet引擎上的Servlet的视图(奇怪的说法?)。 通过使用这个对象，Servlet可以记录事件、得到资源并得到来自Servlet引擎的类（例如RequestDispatcher对象）。一个 Servlet只能运行在一个Servlet环境中，但是不同的Servlet可以在Servlet引擎上有不同的视图。  如果Servlet引擎支持虚拟主机，每个虚拟主机有一个Servlet环境。一个Servlet环境不能在虚拟主机之间共享。  Servlet引擎能够允许一个Servlet环境有它自己的活动范围。  例如，一个Servlet环境是属于bank应用的，它将被映射到/bank目录下。在这种情况下，一个对getContext方法的调用会返回 /bank的Servlet环境。</p>
<p>javascript 中的上下文，则说法更让我迷惑。</p>
<p>1.javascript这种脚本语言执行的时候都有一个全局上下文对象，而浏览器里面javascript的全局上下文就是window，所有没有指定目标的定义都会定义在window的属性上。<br>2.上下文对象指的就是this对象。它是一个只能读取而不能直接赋值的对象（就是你只能对this拥有的属性和方法赋值）。<br>由第一条分析，上下文则是环境，js得以运行的环境。而第二条则更像是一个属性？还是一个局部(div等)的环境？</p>
<p>ECMA文档里面有个Execution Contexts，我觉得它更确切的说是执行环境：<br>当控制转交到ECMAScript执行代码,控制进入到一个执行环境(上下文)。活动(生效)的执行环境逻辑上来自一个栈.顶端的执行环境在这个逻辑栈是 运行中的执行环境,一个新的执行环境被创建当控制从可执行代码中转移。其与临时运行的执行环境关联到的可执行代码将不和这个执行上下文关联.新的执行上下 文将被推入到栈并称为运行中的执行上下文。原文:<br>When control is transferred to ECMAScript executable code, control is  entering an execution context. Active execution contexts logically form a  stack. The top execution context on this logical stack is the running  execution context. A new execution context is created whenever control  is transferred from the executable code associated with the currently  running execution context to executable code that is not associated with  that execution context. The newly created execution context is pushed  onto the stack and becomes the running execution context.</p>
<p>所以：java中的context更多指的是应用运行环境，而javascript中则表示脚本执行的一个环境？</p>

      
    </div>
    <footer class="article-footer">
<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_fbook" data-cmd="fbook" title="分享到Facebook"></a><a href="#" class="bds_linkedin" data-cmd="linkedin" title="分享到linkedin"></a><a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/java/">java</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/javascript/">javascript</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/上下文/">上下文</a></li></ul>

    </footer>
  </div>
  


</article>
  
    <article id="post-id-e4-b8-8eclass-e7-9a-84-e6-b8-b2-e6-9f-93-e6-95-88-e7-8e-87-e5-af-b9-e6-af-94-which-one-is-more-efficient-id-or-class" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2010/08/26/id-e4-b8-8eclass-e7-9a-84-e6-b8-b2-e6-9f-93-e6-95-88-e7-8e-87-e5-af-b9-e6-af-94-which-one-is-more-efficient-id-or-class/" class="article-date">
  <time datetime="2010-08-25T20:57:23.000Z" itemprop="datePublished">2010-08-26</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/web-development/">web development</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2010/08/26/id-e4-b8-8eclass-e7-9a-84-e6-b8-b2-e6-9f-93-e6-95-88-e7-8e-87-e5-af-b9-e6-af-94-which-one-is-more-efficient-id-or-class/">Id与class的渲染效率对比_which one is more efficient id or class</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>国外有篇文章叫《Efficiently Rendering CSS》里面讲到ID选择器是最有效率的，我不这样认为，某些方面，id与class在渲染效率上不相上下,所以没有到必须的时候，个人建议使用class作为选择器,具体可以看下面的效率测试。</p>
<p><span style="color: darkred;">首先讲几个前提：</span><br>－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－<br><strong>css渲染分三种情况</strong><br>1.首次加载渲染<br>2.css和html调用缓存渲染<br>3.html文件调用缓存渲染</p>
<p><strong>渲染的顺序</strong><br>ff,chrome,safari,opera 最新版本的浏览器是在加载的同时进行css样式的渲染和展现(或者说是同步进行)。<br>而ie 8 是在文档加载完成后展现，而在渲染过程中是无法见到网页展现的</p>
<p><strong>渲染效率与什么有关？</strong><br>1.css选择器的查询定位效率<br>2.浏览器的渲染模式和算法<br>3.要进行渲染内容的大小</p>
<p><span style="color: darkred;">测试：</span></p>
<p>－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－<br>OS ：win xp<br>硬件：内存 4G，CPU 酷睿4核<br>web容器：tomcat 6.0</p>
<p>浏览器 ：ff 3.6</p>
<p><span style="color: darkred;">说明:</span><br>1.为使得结果更加客观真实，html文档包含各种标签元素<br>2.样式用在了class元素上和id的元素上<br>3.id选择器和class选择器的渲染测试，每一项测试30次，取均值</p>
<p><span style="color: darkred;">html文件</span><br><a href="http://www.webdevelopmentmachine.com/download/html%20files.rar" target="_blank" rel="noopener"><strong>html files.rar</strong></a> (9.25 KB)</p>
<p><span style="color: darkred;">结果对比：</span></p>
<p><table border="1" width="100%"></table></p>
<p><tbody></tbody></p>
<p><tr></tr></p>
<p><td>序号</td></p>
<p><td>选择器</td></p>
<p><td>首次载入(s)</td></p>
<p><td>刷新页面(s)</td></p>
<p><td>修改属性值后刷新(s)</td></p>
<p><td>选择器</td></p>
<p><td>首次载入(s)</td></p>
<p><td>刷新页面(s)</td></p>
<p><td>修改属性值后刷新 (s)</td><br></p>
<p><tr></tr></p>
<p><td>1.</td></p>
<p><td>.box</td></p>
<p><td>4.55</td></p>
<p><td>4.38</td></p>
<p><td>4.77</td></p>
<p><td>#wrap</td></p>
<p><td>4.55</td></p>
<p><td>5.02</td></p>
<p><td>4.48</td><br></p>
<p><tr></tr></p>
<p><td>2.</td></p>
<p><td></td></p>
<p><td>4.54</td></p>
<p><td>4.4</td></p>
<p><td>4.74</td></p>
<p><td></td></p>
<p><td>4.49</td></p>
<p><td>4.34</td></p>
<p><td>4.55</td><br></p>
<p><tr></tr></p>
<p><td>30.</td></p>
<p><td></td></p>
<p><td>4.52</td></p>
<p><td>4.32</td></p>
<p><td>4.53</td></p>
<p><td></td></p>
<p><td>4.56</td></p>
<p><td>4.35</td></p>
<p><td>4.5</td><br></p>
<p><tr></tr></p>
<p><td>均值</td></p>
<p><td></td></p>
<p><td>4.627</td></p>
<p><td>4.503</td></p>
<p><td>4.839</td></p>
<p><td></td></p>
<p><td>4.534</td></p>
<p><td>4.403</td></p>
<p><td>4.441</td><br><br><br><br><strong>结论：</strong><br>－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－<br>就整个文档的首次载入和刷新的渲染效率来看，id比class快0.1s左右，可以说不相上下。<br>在修改css属性值后刷新，id的速度比class快0.4s作用<br>若：<br>修改background-color值后刷新用时－刷新页面用时 ＝ 这个属性的渲染用时<br>则：<br>class选择器属性渲染用时为 4.839s－4.503s ＝ 0.436s<br>id选择器属性渲染用时为 4.441s－4.403s ＝ 0.038s<br>即:<br>id选择器属性渲染 比 class 选择器属性渲染 快约 0.4s<br><strong>所以：id选择器的效率和class选择器相比是很微小的，可以认为两者不相上下</strong></p>

      
    </div>
    <footer class="article-footer">
<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_fbook" data-cmd="fbook" title="分享到Facebook"></a><a href="#" class="bds_linkedin" data-cmd="linkedin" title="分享到linkedin"></a><a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/CSS/">CSS</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/html/">html</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/性能/">性能</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/效率/">效率</a></li></ul>

    </footer>
  </div>
  


</article>
  
    <article id="post-css-e9-9d-a2-e5-90-91-e5-af-b9-e8-b1-a1-e7-bb-93-e6-9e-84-e8-ae-be-e8-ae-a1-css-object-oriented-structure-design" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2010/08/26/css-e9-9d-a2-e5-90-91-e5-af-b9-e8-b1-a1-e7-bb-93-e6-9e-84-e8-ae-be-e8-ae-a1-css-object-oriented-structure-design/" class="article-date">
  <time datetime="2010-08-25T20:35:04.000Z" itemprop="datePublished">2010-08-26</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/CSS-amp-HTML/">CSS &amp; HTML</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2010/08/26/css-e9-9d-a2-e5-90-91-e5-af-b9-e8-b1-a1-e7-bb-93-e6-9e-84-e8-ae-be-e8-ae-a1-css-object-oriented-structure-design/">CSS 面向对象结构设计_CSS Object Oriented Structure Design</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>看过国外和国内的一些面向对象的css文章，他们借用js或php实现了继承，重用。这样做到底对我们工作的简化，效率的提高有多少好处我不得而知。</p>
<p>而我现在做的是用现有的css实现面向对象的结构，并且借鉴J2EE 的mvc架构实现css的高度复用,快速开发和简便维护，以下是面向对象结构的简要介绍和代码实现。</p>
<h2 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h2><p>在日常的开发中总有重复的代码要写，熟悉了自然就快了，当然工作质量肯定能保证，但每天写这些重复的代码多少有点无味。css可以面向对象吗？不可以。所以很多人用javascript来辅助实现，能不使用js来实现吗，我想试一试。之所以不能达到大规模的重用，我认为是css的class粒度不够细，就像下面这行代码，我敢保证一个页面最多只能用一次：<br><span style="color: #ff0000;">#banner #nav li a{ height:92px; width:142px; text-align:center; display:block; background:url(../images/link_common_bg.png) repeat-x 0 top; text-decoration:none; color:#666;<br>font:bold 1.5em/100px arial,verdana; color:#666; }</span><br>而里面的许多属性，我敢保证你使用了千万次：<br><span style="color: #ff0000;">text-align:center; display:block;text-decoration:none;font-weight: normal;</span><br>为什么不把使用了千万次的单个属性单独写成一个类，以便重复调用？换句话说，就是让这些单一的属性成为一个个的小”积木块”，需要的时候拿来自由组合。例如font属性font-family富于多变，而font-weight的属性值永远只有那几种。甚至是font-size属性，也有一个常用值：font-size:12px;这些常用值都可以被写成一个单独对象。<br>并且我在页面也加入了page通用的对象如banner，sidebar等等，加入它们是因为可以利用css同名类属性合并的特性，这样这真正的项目代码中页面对象里面的样式属性可以顺利被继承或重写(这一点和java的面向对象很类似)。<br>在页面中标签的class类个数会较多，但刚好页面可以使用一个java的自定义标签来将每个细粒度的类进行配置，这刚好实现了页面的简便维护和低耦合。</p>
<h2 id="css面向对象的结构"><a href="#css面向对象的结构" class="headerlink" title="css面向对象的结构"></a><strong>css面向对象的结构</strong></h2><p>[caption id=”” align=”alignnone” width=”600”]<img src="http://www.webdevelopmentmachine.com/images/cssoo.jpg" alt="css 面向对象结构设计图"> css 面向对象结构设计图[/caption]</p>
<h2 id="对java-mvc结构的引用"><a href="#对java-mvc结构的引用" class="headerlink" title="对java mvc结构的引用"></a>对java mvc结构的引用</h2><p>[caption id=”” align=”alignnone” width=”600”]<img src="http://www.webdevelopmentmachine.com/images/mvc.jpg" alt="mvc结构的应用"> mvc结构的应用[/caption]</p>
<p><strong>1. 现有框架解决了什么问题，缺点是什么？</strong></p>
<p>样式重设，IE bug处理，缺点是没有进行对象结构扩展，实现最大程度的复用。</p>
<p><strong>2. 我所面临的问题？</strong></p>
<p>不断重复类似功能的代码,并且面向结构，复用度太低,应该在功能上进行完全的分离。</p>
<p><strong>3. 我要实现的目标？</strong></p>
<p>90%以上css代码的重用，面向对象结构，加入细粒度对象和布局对象，加入CSS交互控制模块和css插件模块。</p>
<p><strong>4. 框架的优点?</strong></p>
<p>多浏览器兼容,遵循web标准,代码量少,结构清晰,快速开发,高度复用，维护简便，易于理解使用。</p>
<p><strong>5. 框架带来的问题?</strong></p>
<p>Html页面过多的class元素，因为放弃多级选择器，导致原本不使用class的元素使用class。</p>
<p><strong>6. 框架如何实现高度复用和简便维护?</strong></p>
<ol>
<li>加入大量的原子对象，以进行自由的重用。</li>
<li>增加页面常用对象,以便在项目代码中进行重写。</li>
<li>使用java taglib来维护class数量过多的页面标签,方便后期扩展和维护(并且taglib很好的解决了Html页面过多的class元素的问题)。</li>
<li>在元素的命名等方面进行约束,避免后期维护困难。</li>
</ol>
<h2 id="命名规则的约束"><a href="#命名规则的约束" class="headerlink" title="命名规则的约束:"></a>命名规则的约束:</h2><p>ID用来作js控制<br>.c_title 下划线表示js控制的css元素<br>.css3_round css3和下划线一起表示css3对象<br>.image-1 中杠表示jquery插件的控制对象</p>
<p>如何实现:</p>
<p><strong>首先</strong>需要一套css reset代码,yahoo css reset和blueprint都是不错的选择。</p>
<p><strong>然后</strong>新建一个css文件，在其中将通用css对象进行创建<br>例如:rain.css</p>
<h2 id=""><a href="#" class="headerlink" title="/**"></a><span style="color: #993300;">/**</span></h2><h2 id="Atomic-Css-Objects"><a href="#Atomic-Css-Objects" class="headerlink" title="Atomic Css Objects"></a>Atomic Css Objects</h2><p><em>/<br>/</em>  font<br>free properties 用于表现的css属性，富于变化，不作设定<br>–font-family<br>–font-size<br>–font<br>*/<br>.fontNormal{ font-style:normal;}<br>.fontItalic{ font-style:italic;}<br>.fontOblique{ font-style:oblique;}<br>…</p>
<h2 id="-1"><a href="#-1" class="headerlink" title="/**"></a><span style="color: #993300;">/**</span></h2><h2 id="Page-Layout-Css-Objects"><a href="#Page-Layout-Css-Objects" class="headerlink" title="Page Layout Css Objects"></a>Page Layout Css Objects</h2><p><em>/<br>/</em>– container object use –*/<br>.container{ width:1000px;}</p>
<p><span style="color: #993300;">/<em>– banner.css – banner object and sub-objects 这些页面布局常用class可以被定义，易于重写–</em>/</span><br>.banner{ margin-bottom:10px; background:#F2F2F2;}<br>.logo{ width:200px; padding:20px 0 0; margin:0;}<br>…</p>
<p><span style="color: #993300;">/<em>– ———-project code 用于实际项目代码对page object对象进行重写———- –</em>/</span><br>input.text, input.title {width:400px;}<br>.text_shadow{    text-shadow: 1px 1px 3px rgba(50, 50, 50, 0.3);}<br>body{ background:url(../images/top_bg.png) repeat-x 0 0;}<br>…</p>
<p><strong>再者</strong>就是页面的应用了，例如home.html</p>
<p>&lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;" target="_blank" rel="noopener">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</a>&gt;<br>&lt;html xmlns=”<a href="http://www.w3.org/1999/xhtml&quot;" target="_blank" rel="noopener">http://www.w3.org/1999/xhtml&quot;</a>&gt;<br>&lt;head&gt;<br>&lt;title&gt;example&lt;/title&gt;<br>&lt;!– Framework CSS –&gt;<br>&lt;link rel=”stylesheet” href=”css/blueprint/screen.css” type=”text/css” media=”screen, projection”/&gt;<br>&lt;!–[if lte IE 8]&gt;&lt;link rel=”stylesheet” href=”css/blueprint/ie.css” type=”text/css” media=”screen, projection”&gt;&lt;![endif]–&gt;<br><span style="color: #993300;">&lt;link rel=”stylesheet” href=”css/rain.css” type=”text/css” media=”screen, projection”/&gt; </span></p>
<p>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;div class=”container”&gt;<br>&lt;div class=”banner”&gt;<br>&lt;h1 class=”logo displayBlock overflowHide”&gt;…&lt;/h1&gt;<br>&lt;/div&gt;<br>&lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</p>
<p>很明显可以看出class类的引用会随着样式的复杂化而越来越多，在<a href="http://www.w3ctech.com" target="_blank" rel="noopener">web交流会</a>上的朋友提出了一个问题：怎样保证样式的变更而页面不需要修改?</p>
<p>这正是使用java taglib来维护class数量过多的页面标签的原因。在java web项目中，可以将csstl.jar拷贝到lib文件夹下,在src文件夹下新建<span style="color: #993300;"><strong>css.properties</strong></span>文件，所以最后home.jsp页面会是这样：</p>
<p>&lt;%@ page contentType=”text/html; charset=utf-8” language=”java” errorPage=””%&gt;<br>&lt;%@ taglib uri=”csstags” prefix=”s”%&gt;</p>
<p>&lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;" target="_blank" rel="noopener">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</a>&gt;<br>&lt;html xmlns=”<a href="http://www.w3.org/1999/xhtml&quot;" target="_blank" rel="noopener">http://www.w3.org/1999/xhtml&quot;</a>&gt;<br>&lt;head&gt;<br>&lt;title&gt;example&lt;/title&gt;<br>&lt;!– Framework CSS –&gt;<br>&lt;link rel=”stylesheet” href=”css/blueprint/screen.css” type=”text/css” media=”screen, projection”/&gt;<br>&lt;!–[if lte IE 8]&gt;&lt;link rel=”stylesheet” href=”css/blueprint/ie.css” type=”text/css” media=”screen, projection”&gt;&lt;![endif]–&gt;<br>&lt;link rel=”stylesheet” href=”css/rain.css” type=”text/css” media=”screen, projection”/&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;div&gt;<br>&lt;div&gt;<br>&lt;h1color: rgb(128, 0, 0);”&gt;&lt;s:cssunit cssunit=”logo”/&gt;”&gt;…&lt;/h1&gt;<br>&lt;/div&gt;<br>&lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</p>
<p>而css.properties文件中则写入要加载的css类:<br>logo = logo displayBlock overflowHide</p>
<p><strong>CSS面向对象结构的实现:</strong><br><a href="http://www.webdevelopmentmachine.com/resources.jsp#cssfromework" target="_blank" rel="noopener">www.webdevelopmentmachine.com/resources.html#cssframework</a></p>

      
    </div>
    <footer class="article-footer">
<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_fbook" data-cmd="fbook" title="分享到Facebook"></a><a href="#" class="bds_linkedin" data-cmd="linkedin" title="分享到linkedin"></a><a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/CSS/">CSS</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Design/">Design</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Structure/">Structure</a></li></ul>

    </footer>
  </div>
  


</article>
  
    <article id="post-e7-81-ab-e7-8b-90firefox-3-x-e4-b8-8bmargin-top-e6-97-a0-e6-95-88-e7-9a-84-e8-a7-a3-e5-86-b3-e6-96-b9-e6-b3-95-how-to-solve-margin-top-not-work-bug-in-firefox-3" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2010/08/15/e7-81-ab-e7-8b-90firefox-3-x-e4-b8-8bmargin-top-e6-97-a0-e6-95-88-e7-9a-84-e8-a7-a3-e5-86-b3-e6-96-b9-e6-b3-95-how-to-solve-margin-top-not-work-bug-in-firefox-3/" class="article-date">
  <time datetime="2010-08-15T08:13:24.000Z" itemprop="datePublished">2010-08-15</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/CSS-amp-HTML/">CSS &amp; HTML</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2010/08/15/e7-81-ab-e7-8b-90firefox-3-x-e4-b8-8bmargin-top-e6-97-a0-e6-95-88-e7-9a-84-e8-a7-a3-e5-86-b3-e6-96-b9-e6-b3-95-how-to-solve-margin-top-not-work-bug-in-firefox-3/">火狐firefox 3.x下margin-top无效的解决方法_How to solve margin-top not work bug in firefox 3</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>经常会出现的一个ff bug，方法也有很多<br>这个一行代码解决：<br>display:inline-block;<br>缺点:<br>老版本浏览器不支持，不过也无所谓，主要是ff的bug，ff支持就可以了<br>Unsupported value: ‘inline-block’<br>Affects: Firefox 1.5; Internet Explorer 6.0, 7.0; Internet Explorer for Macintosh 5.2; Opera 8.0, 9.0; Safari 2.0</p>

      
    </div>
    <footer class="article-footer">
<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_fbook" data-cmd="fbook" title="分享到Facebook"></a><a href="#" class="bds_linkedin" data-cmd="linkedin" title="分享到linkedin"></a><a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/bug/">bug</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/firefox/">firefox</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/html/">html</a></li></ul>

    </footer>
  </div>
  


</article>
  
    <article id="post-seam2-e9-97-ae-e9-a2-98-e6-b1-87-e6-80-bb" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2010/06/10/seam2-e9-97-ae-e9-a2-98-e6-b1-87-e6-80-bb/" class="article-date">
  <time datetime="2010-06-10T06:45:04.000Z" itemprop="datePublished">2010-06-10</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/java-web/">java web</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2010/06/10/seam2-e9-97-ae-e9-a2-98-e6-b1-87-e6-80-bb/">seam2问题汇总</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>EntityMaganer 注入失效<br><a href="http://www.javaeye.com/topic/88345" target="_blank" rel="noopener">http://www.javaeye.com/topic/88345</a></p>
<p>2.jboss链接数的问题<br>INFO   [CachedConnectionManager] Closing a connection for you.  Please close  them yourself:  org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6@1c0f6d9<br>java.lang.Throwable: STACKTRACE<br><a href="http://xumiao.javaeye.com/blog/488000" target="_blank" rel="noopener">http://xumiao.javaeye.com/blog/488000</a></p>
<p><a href="http://forums.sun.com/thread.jspa?threadID=737400" target="_blank" rel="noopener">http://forums.sun.com/thread.jspa?threadID=737400</a></p>
<p><a href="http://issues.liferay.com/browse/LPS-405" target="_blank" rel="noopener">http://issues.liferay.com/browse/LPS-405</a></p>
<p>3.<br>14:39:32,448 ERROR [SchemaUpdate] could not complete schema update<br>java.sql.SQLException: You cannot set autocommit during a managed transaction!</p>
<p>&lt;property name=”hibernate.hbm2ddl.auto” value=”update” /&gt;作怪<br>如果没有此方面的需求建议set value=”none”.</p>
<p>其它几个参数的意思:</p>
<p>validate               加载hibernate时，验证创建数据库表结构</p>
<p>create                  每次加载hibernate，重新创建数据库表结构<br>create-drop        加载hibernate时创建，退出是删除表结构<br>update                 加载hibernate自动更新数据库结构</p>
<p>4.Caused  by: javax.resource.ResourceException: Transaction is not active:  tx=TransactionImple &lt; ac, BasicAction: -3f57fe0b:b20:4c08b00e:64  status: ActionStatus.ABORT_ONLY &gt;</p>
<p>部分代码有异常未被捕获，导致程序出错<br>It turned out that this is not a hibernate or jboss exception at all.  The actual cause of this was a <code>NullPointerException</code> somewhere in the flow of the application. This caused the transaction  to  end and re-enter a loop when the transaction was not active and this   was thrown. So if you ever get this exception I suggest you put some   break points in your code and see where it fails. It’s likely that there   is an unchecked exception thrown somewhere in your programme.</p>
<p>5.<a href="http://seamframework.org/Community/UnableToQueryDatabaseQuerySyntaxExceptionObjectIsNotMapped" target="_blank" rel="noopener">Unable to query database - QuerySyntaxException:  (object) is not mapped</a><br>used the fully qualified name/使用完整的类名:com.XX.entity.类</p>
<p>6.javax.ejb.EJBException: java.lang.IllegalArgumentException: Unknown  entity<br>在persistence.xml 文件加入类全路径&lt;class&gt;org.domain.ctiproxy.entity.ContactosUteis&lt;/class&gt;<br><a href="http://seamframework.org/Community/JavalangIllegalArgumentExceptionUnknownEntity" target="_blank" rel="noopener">http://seamframework.org/Community/JavalangIllegalArgumentExceptionUnknownEntity</a></p>
<p>7.javax.persistence.TransactionRequiredException: no transaction is in progress</p>

      
    </div>
    <footer class="article-footer">
<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_fbook" data-cmd="fbook" title="分享到Facebook"></a><a href="#" class="bds_linkedin" data-cmd="linkedin" title="分享到linkedin"></a><a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
      
    </footer>
  </div>
  


</article>
  
    <article id="post-5-e6-9c-8829-e6-97-a5web-e4-ba-a4-e6-b5-81-e4-bc-9a-e7-9a-84-e6-94-b6-e8-8e-b7-e5-8f-8a-e6-88-91-e7-9a-84-e7-bb-8f-e9-aa-8c-e5-88-86-e4-ba-ab" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2010/06/02/5-e6-9c-8829-e6-97-a5web-e4-ba-a4-e6-b5-81-e4-bc-9a-e7-9a-84-e6-94-b6-e8-8e-b7-e5-8f-8a-e6-88-91-e7-9a-84-e7-bb-8f-e9-aa-8c-e5-88-86-e4-ba-ab/" class="article-date">
  <time datetime="2010-06-02T12:45:01.000Z" itemprop="datePublished">2010-06-02</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/CSS-amp-HTML/">CSS &amp; HTML</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2010/06/02/5-e6-9c-8829-e6-97-a5web-e4-ba-a4-e6-b5-81-e4-bc-9a-e7-9a-84-e6-94-b6-e8-8e-b7-e5-8f-8a-e6-88-91-e7-9a-84-e7-bb-8f-e9-aa-8c-e5-88-86-e4-ba-ab/">5月29日web交流会的收获及我的经验分享</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p><strong>先说收获：</strong><br>1.龙钢同学讲到的，设计稿版本控制的一个好的方法<br>designer在新稿出来后用邮件抄送到个人开发人员的邮箱，保证psd文件是最新版本。</p>
<p>2.导航栏的hover效果处理<br>关于ie6在其他元素不支持hover事件的问题，有人建议用js处理这个功能，但Along建议只针对ie6写js，使用&lt;!–[if IE 6]&gt;…&lt;![endif]–&gt; 进行注释，我比较赞同，毕竟以后维护起来很方便。</p>
<p>3.Niel对outline属性的讲解<br>这个是轮廓的样式我很少用到，但很不错，以后可以用到开发中<br>w3school里面的介绍<br><a href="http://www.w3school.com.cn/css/pr_outline-style.asp" target="_blank" rel="noopener">http://www.w3school.com.cn/css/pr_outline-style.asp</a></p>
<p><strong>我的ppt里面的一点补充</strong><br>结构的分离</p>
<p>CSS文件与页面分离</p>
<p>通用JavaScript脚本和JavaScript框架与页面分离<br>一个页面有三种脚本文件，通用脚本，js框架文件，操作部分动态代码的脚本。<br>前两种文件与页面分离</p>
<p>后端标签语言只作数据展现使用</p>
<p>框架的集成<br>CSS使用blueprint 等框架<br><a href="http://www.blueprintcss.org/" target="_blank" rel="noopener">http://www.blueprintcss.org/</a><br>各人的喜好不同，css框架也可以自己去写，但在一个框架之上进行修整和扩展也是一个不错的选择，并且时间久了，个人的css库也就成形了，自然开发就会高效很多。</p>
<p>JavaScript 使用Jquery 及其扩展框架</p>
<p>后端标签语言使用jstl，JSF等<br>在java里面最多的是用jstl和el表达式，自己正在使用jsf。</p>
<p>如何分割与合并<br>CSS根据作用区域和功能模块进行注释</p>
<p>JS代码按照功能模块注释</p>
<p>与动态部分交互js脚本写在页面末端</p>
<p>样例：<br>&lt;%@ page language=”java” contentType=”text/html; charset=UTF-8” pageEncoding=”UTF-8”%&gt;<br>&lt;%@ taglib prefix=”c” uri=”<a href="http://java.sun.com/jsp/jstl/core&quot;%" target="_blank" rel="noopener">http://java.sun.com/jsp/jstl/core&quot;%</a>&gt;</p>
<p>&lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;" target="_blank" rel="noopener">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</a>&gt;<br>&lt;html xmlns=”<a href="http://www.w3.org/1999/xhtml&quot;" target="_blank" rel="noopener">http://www.w3.org/1999/xhtml&quot;</a>&gt;<br>&lt;head&gt;<br>&lt;title&gt;&lt;/title&gt;<br>&lt;link type=”image/x-icon” rel=”shortcut icon” href=”images/favicon.ico” /&gt;<br>&lt;meta http-equiv=”Content-Type” content=”text/html; charset=utf-8” /&gt;&amp;#160;</p>
<p>&lt;!– Framework CSS –&gt;<br>&lt;link type=”text/css” rel=”stylesheet” href=”css/blueprint/screen.css” media=”screen, projection” /&gt;<br>&lt;link type=”text/css” rel=”stylesheet” href=”css/blueprint/print.css”&amp;#160; media=”print” /&gt;<br>&lt;link type=”text/css” rel=”stylesheet” href=”css/common.css” /&gt;</p>
<p>&lt;!–[if  lte IE 8]&gt;&lt;link rel=”stylesheet” href=”css/blueprint/ie.css”  type=”text/css” media=”screen, projection”/&gt;&lt;![endif]–&gt;<br>&lt;!–[if IE 6]&gt;<br>&lt;script type=”text/javascript” src=”js/DD_belatedPNG_0.0.8a-min.js”&gt;&lt;/script&gt;<br>&lt;script type=”text/javascript”&gt;<br>/<em> string argument can be any CSS selector and img elements</em>/<br>DD_belatedPNG.fix(‘#playnow,#gamelist,.browse’);&amp;#160;<br>&lt;/script&gt;<br>&lt;![endif]–&gt;<br>&lt;/head&gt;</p>
<p>&lt;body&gt;<br>&lt;div id=”container”&gt;<br>结构代码。。。<br>&lt;/div&gt;</p>
<p>&lt;script type=”text/javascript” src=”js/jquery-1.4.2.min.js”&gt;&lt;/script&gt;<br>&lt;script type=”text/javascript” src=”js/jquery.tools.min.js”&gt;&lt;/script&gt;<br>&lt;script type=”text/javascript” src=”js/common-slide.js”&gt;&lt;/script&gt;<br>&lt;script type=”text/javascript”&gt;<br>$(function() {<br>操作后台数据的js代码。。。<br>});<br>&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br><strong><br>严格的标准</strong><br>用最简单(合适)的代码兼容最多的浏览器<br>小志同学认为简单应改为合适，我100%同意，并且css代码应当简单且合适，不是么。</p>
<p>对Html和css进行严格验证(html validator,css validator)</p>
<p>先标准再IE<br><strong><br>与后端的集成</strong><br>与功能的妥协</p>
<p>与框架的妥协</p>
<p>尽量高的效率</p>
<p>例如：本来合并在一起的图片被分成若干张，本来一次请求变成多次请求，后端标签语言在页面运行后html和css验证无法通过等等，万事难做到完美，但尽量做到最好吧。^_^</p>

      
    </div>
    <footer class="article-footer">
<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_fbook" data-cmd="fbook" title="分享到Facebook"></a><a href="#" class="bds_linkedin" data-cmd="linkedin" title="分享到linkedin"></a><a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
      
    </footer>
  </div>
  


</article>
  
    <article id="post-java-e4-b8-ad-e8-8e-b7-e5-8f-96-e7-9b-b8-e5-af-b9-e8-b7-af-e5-be-84-e3-80-81-e7-bb-9d-e5-af-b9-e8-b7-af-e5-be-84-e6-80-bb-e7-bb-93-e8-bd-ac-e8-bd-bd" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2010/04/27/java-e4-b8-ad-e8-8e-b7-e5-8f-96-e7-9b-b8-e5-af-b9-e8-b7-af-e5-be-84-e3-80-81-e7-bb-9d-e5-af-b9-e8-b7-af-e5-be-84-e6-80-bb-e7-bb-93-e8-bd-ac-e8-bd-bd/" class="article-date">
  <time datetime="2010-04-27T09:19:38.000Z" itemprop="datePublished">2010-04-27</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/java-web/">java web</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2010/04/27/java-e4-b8-ad-e8-8e-b7-e5-8f-96-e7-9b-b8-e5-af-b9-e8-b7-af-e5-be-84-e3-80-81-e7-bb-9d-e5-af-b9-e8-b7-af-e5-be-84-e6-80-bb-e7-bb-93-e8-bd-ac-e8-bd-bd/">JAVA中获取相对路径、绝对路径总结_转载</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <p>我在csdn上的提问：<a href="http://topic.csdn.net/u/20100427/16/b5fc390a-016f-4703-9b22-5e49666265a7.html" target="_blank" rel="noopener">http://topic.csdn.net/u/20100427/16/b5fc390a-016f-4703-9b22-5e49666265a7.html</a><br>1.基本概念的理解</p>
<p>绝对路径：绝对路径就是你的主页上的文件或目录在硬盘上真正的路径，(URL和物理路径)例如：<br>C:\xyz\test.txt 代表了test.txt文件的绝对路径。<a href="http://www.sun.com/index.htm也" target="_blank" rel="noopener">http://www.sun.com/index.htm也</a> 代表了一个<br>URL绝对路径。</p>
<p>相对路径：相对与某个基准目录的路径。包含Web的相对路径（HTML中的相对目录），例如：在<br>Servlet 中，”/“代表Web应用的跟目录。和物理路径的相对表示。例如：”./“ 代表当前目录,<br>“../“代表上级目录。这种类似的表示，也是属于相 对路径。</p>
<p>另外关于URI，URL,URN等内容，请参考RFC相关文档标准。</p>
<p>RFC 2396: Uniform Resource Identifiers (URI): Generic Syntax,<br>(<a href="http://www.ietf.org/rfc/rfc2396.txt" target="_blank" rel="noopener">http://www.ietf.org/rfc/rfc2396.txt</a>)</p>
<p>2.关于JSP/Servlet中的相对路径和绝对路径。</p>
<p>2.1服务器端的地址</p>
<p>服务器端的相对地址指的是相对于你的web应用的地址，这个地址是在服务器端解析的<br>（不同于html和javascript中的相对 地址，他们是由客户端浏览器解析的）也就是说这时候<br>在jsp和servlet中的相对地址应该是相对于你的web应用，即相对于<a href="http://192.168.0.1/webapp/的。" target="_blank" rel="noopener">http://192.168.0.1/webapp/的。</a></p>
<p>其用到的地方有：<br>forward：servlet中的 request.getRequestDispatcher(address);这个address是<br>在服务器端解析的，所以，你要 forward到a.jsp应该这么写：<br>request.getRequestDispatcher(“/user/a.jsp”)这个/相对于 当前的web应用webapp，<br>其绝对地址就是：<a href="http://192.168.0.1/webapp/user/a.jsp。" target="_blank" rel="noopener">http://192.168.0.1/webapp/user/a.jsp。</a><br>sendRedirect：在jsp中&lt;%response.sendRedirect(“/rtccp/user /a.jsp”);%&gt;</p>
<p>2.22、客户端的地址</p>
<p>所有的html页面中的相对地址都是相对于服务器根目录(<a href="http://192.168.0.1/" target="_blank" rel="noopener">http://192.168.0.1/</a>) 的，<br>而不是(跟目录下的该Web应用的目录)<a href="http://192.168.0.1/webapp/的。" target="_blank" rel="noopener">http://192.168.0.1/webapp/的。</a><br>Html中的form表单的 action属性的地址应该是相对于服务器根目录(<a href="http://192.168.0.1/" target="_blank" rel="noopener">http://192.168.0.1/</a>) 的，<br>所以，如果提交到a.jsp为：action＝”/webapp/user/a.jsp”或action=”&amp; lt;%=request.getContextPath()%&gt;”/user/a.jsp；<br>提交到servlet为 actiom＝”/webapp/handleservlet”<br>Javascript也是在客户端解析的，所以其相对路径和form表 单一样。</p>
<p>因此，一般情况下，在JSP/HTML页面等引用的CSS,Javascript.Action等属性前面最好都加上<br>&lt;%=request.getContextPath()%&amp; gt;,以确保所引用的文件都属于Web应用中的目录。<br>另外，应该尽量避免使用类似”.”,”./“,”../../“等类似的相对该文件位置的 相对路径，这样<br>当文件移动时，很容易出问题。</p>
<p>3. JSP/Servlet中获得当前应用的相对路径和绝对路径<br>3.1 JSP中获得当前应用的相对路径和绝对路径<br>根目录所对应的绝对路径:request.getRequestURI()<br>文 件的绝对路径    　:application.getRealPath(request.getRequestURI());<br>当前web应 用的绝对路径 :application.getRealPath(“/“);<br>取得请求文件的上层目录:new File(application.getRealPath(request.getRequestURI())).getParent()</p>
<p>3.2 Servlet中获得当前应用的相对路径和绝对路径<br>根目录所对应的绝对路 径:request.getServletPath();<br>文件的绝对路径    :request.getSession().getServletContext().getRealPath<br>(request.getRequestURI())<br>当前web应用的绝对路径 :servletConfig.getServletContext().getRealPath(“/“);<br>(ServletContext对象获得几种方式：<br>javax.servlet.http.HttpSession.getServletContext()<br>javax.servlet.jsp.PageContext.getServletContext()<br>javax.servlet.ServletConfig.getServletContext()<br>)</p>
<p>4.java 的Class中获得相对路径，绝对路径的方法<br>4.1 单独的Java类中获得绝对路径<br>根据java.io.File的Doc文挡，可知:<br>默认情况下new File(“/“)代表的目录为：System.getProperty(“user.dir”)。<br>一下程序获得执行类的当前路径<br>package org.cheng.file;<br>import java.io.File;</p>
<p>public class FileTest {<br>public static void main(String[] args) throws Exception {</p>
<p>System.out.println(Thread.currentThread().getContextClassLoader().getResource(“”));</p>
<p>System.out.println(FileTest.class.getClassLoader().getResource(“”));</p>
<p>System.out.println(ClassLoader.getSystemResource(“”));<br>System.out.println(FileTest.class.getResource(“”));<br>System.out.println(FileTest.class.getResource(“/“)); //Class文件所在路径<br>System.out.println(new File(“/“).getAbsolutePath());<br>System.out.println(System.getProperty(“user.dir”));<br>}<br>}</p>
<p>4.2服务器中的Java类获得当前路径（来自网络）<br>(1).Weblogic</p>
<p>WebApplication的系统文件根目录是你的weblogic安装所在根目录。<br>例如：如果你的weblogic安装在c:\bea \weblogic700…..<br>那么，你的文件根路径就是c:.<br>所以，有两种方式能够让你访问你的服务器端的文件：<br>a.使 用绝对路径：<br>比如将你的参数文件放在c:\yourconfig\yourconf.properties，<br>直接使用 new FileInputStream(“yourconfig/yourconf.properties”);<br>b.使用相对路径：<br>相对路径的 根目录就是你的webapplication的根路径，即WEB-INF的上一级目录，将你的参数文件放</p>
<p>在yourwebapp\yourconfig\yourconf.properties，<br>这样使用：<br>new FileInputStream(“./yourconfig/yourconf.properties”);<br>这两种方式均可，自己选择。</p>
<p>(2).Tomcat</p>
<p>在类中输出System.getProperty(“user.dir”);显示的是%Tomcat_Home%/bin</p>
<p>(3).Resin</p>
<p>不是你的JSP放的相对路径,是JSP引擎执行这个JSP编译成SERVLET<br>的路径为根.比如用新建文件法测试File f = new File(“a.htm”);<br>这个a.htm在resin的安装目录下</p>
<p>(4).如何读相对路径哪？</p>
<p>在Java文件中getResource或getResourceAsStream均可</p>
<p>例：getClass().getResourceAsStream(filePath);//filePath可以是”/filename”,这 里的/代表web</p>
<p>发布根路径下WEB-INF/classes</p>
<p>默认使用该方法的路径是：WEB-INF/classes。已经在Tomcat中测试。</p>
<p>5.读取文件时的相对路径，避免硬编码和绝对路径的使用。（来自网络）<br>5.1 采用Spring的DI机制获得文件，避免硬编码。<br>参考下面的连接内容：<br><a href="http://www.javajia.net/viewtopic.php?p=90213" target="_blank" rel="noopener">http://www.javajia.net/viewtopic.php?p=90213</a>&amp;<br>5.2 配置文件的读取<br>参考下面的连接内容：<br><a href="http://dev.csdn.net/develop/article/39/39681.shtm" target="_blank" rel="noopener">http://dev.csdn.net/develop/article/39/39681.shtm</a><br>5.3 通过虚拟路径或相对路径读取一个xml文件，避免硬编码<br>参考下面的连接内容：<br><a href="http://club.gamvan.com/club/clubPage.jsp?iPage=1&amp;tID=10708&amp;ccID=8" target="_blank" rel="noopener">http://club.gamvan.com/club/clubPage.jsp?iPage=1&amp;tID=10708&amp;ccID=8</a></p>
<p>6.Java 中文件的常用操作（复制，移动，删除，创建等）（来自网络）<br>常用 java File 操作类<br><a href="http://www.easydone.cn/014/200604022353065155.htm" target="_blank" rel="noopener">http://www.easydone.cn/014/200604022353065155.htm</a></p>
<p>Java 文件操作大全（JSP中）<br><a href="http://www.pconline.com.cn/pcedu/empolder/gj/java/0502/559401.html" target="_blank" rel="noopener">http://www.pconline.com.cn/pcedu/empolder/gj/java/0502/559401.html</a></p>
<p>java文件操作详解（Java中文网）<br><a href="http://www.51cto.com/html/2005/1108/10947.htm" target="_blank" rel="noopener">http://www.51cto.com/html/2005/1108/10947.htm</a></p>
<p>JAVA 如何创建\删除\修改\复制目录及文件<br><a href="http://www.gamvan.com/developer/java/2005/2/264.html" target="_blank" rel="noopener">http://www.gamvan.com/developer/java/2005/2/264.html</a></p>
<p>总结：<br>通过上面内容的使用，可以解决在Web应用服务 器端，移动文件，查找文件，复制<br>删除文件等操作，同时对服务器的相对地址，绝对地址概念更加清晰。<br>建议参考URI,的RFC标准文挡。 同时对Java.io.File. Java.net.URI.等内容了解透彻<br>对其他方面的理解可以更加深入和透彻。</p>
<p>原文 :<a href="http://ajava.org/course/java/14394.html" target="_blank" rel="noopener">http://ajava.org/course/java/14394.html</a></p>

      
    </div>
    <footer class="article-footer">
<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_fbook" data-cmd="fbook" title="分享到Facebook"></a><a href="#" class="bds_linkedin" data-cmd="linkedin" title="分享到linkedin"></a><a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
      
    </footer>
  </div>
  


</article>
  
  
    <nav id="page-nav">
      <a class="extend prev" rel="prev" href="/page/11/">&laquo; Prev</a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/10/">10</a><a class="page-number" href="/page/11/">11</a><span class="page-number current">12</span><a class="page-number" href="/page/13/">13</a><a class="extend next" rel="next" href="/page/13/">Next &raquo;</a>
    </nav>
  
</section>
        
          <aside id="sidebar">
  
    <div class="widget-wrap">
  <h3 class="widget-title">Github</h3>
  <div class="widget">
    <ul class="category-list"><li class="category-list-item"><a href="https://github.com/rainzhai">https://github.com/rainzhai</a></li></ul>
  </div>
</div>

  <div class="widget-wrap">
    <h3 class="widget-title">分类 Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/CSS/">CSS</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/CSS-amp-HTML/">CSS &amp; HTML</a><span class="category-list-count">29</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/CSS-amp-HTML/html5/">html5</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/CSS-amp-HTML/javascript-amp-Ajax/">javascript &amp; Ajax</a><span class="category-list-count">2</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/CSS-amp-HTML/javascript-amp-Ajax/移动端开发/">移动端开发</a><span class="category-list-count">1</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/CSS-amp-HTML/web-development/">web development</a><span class="category-list-count">2</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/CSS-amp-HTML/web-development/移动端开发/">移动端开发</a><span class="category-list-count">1</span></li></ul></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/blog/">blog</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/computer-science/">computer science</a><span class="category-list-count">10</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/computer-science/java-web/">java web</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/computer-science/web-development/">web development</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/computer-science/算法/">算法</a><span class="category-list-count">2</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/html5/">html5</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/hybrid/">hybrid</a><span class="category-list-count">2</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/hybrid/phonegap/">phonegap</a><span class="category-list-count">1</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/java-web/">java web</a><span class="category-list-count">10</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/javascript-amp-Ajax/">javascript &amp; Ajax</a><span class="category-list-count">23</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/javascript-amp-Ajax/jquery/">jquery</a><span class="category-list-count">1</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/javascript-amp-Ajax/jquery/web-development/">web development</a><span class="category-list-count">1</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/javascript-amp-Ajax/web-development/">web development</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/javascript-amp-Ajax/算法/">算法</a><span class="category-list-count">1</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/jquery/">jquery</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nodejs/">nodejs</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/php/">php</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/web-development/">web development</a><span class="category-list-count">15</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/前端/">前端</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/智趣/">智趣</a><span class="category-list-count">5</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/智趣/游戏/">游戏</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/智趣/生活/">生活</a><span class="category-list-count">1</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/未分类/">未分类</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/模块化/">模块化</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/游戏/">游戏</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/生活/">生活</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/资源/">资源</a><span class="category-list-count">1</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">标签 Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/Angularjs/">Angularjs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/CSS/">CSS</a><span class="tag-list-count">21</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/CSS-3/">CSS 3</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/D2/">D2</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/DIY/">DIY</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Design/">Design</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Structure/">Structure</a><span class="tag-list-count">8</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/android/">android</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/app/">app</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/blog/">blog</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/bug/">bug</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/css3/">css3</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/debug/">debug</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/dojo/">dojo</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/easy-ui/">easy ui</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/firefox/">firefox</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/flash/">flash</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/free-hosting/">free hosting</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/game/">game</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/geekTime/">geekTime</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/html/">html</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/html5/">html5</a><span class="tag-list-count">18</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hybrid/">hybrid</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ie/">ie</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ios/">ios</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/java/">java</a><span class="tag-list-count">9</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/javascript/">javascript</a><span class="tag-list-count">28</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/jquery/">jquery</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/jquery-mobile/">jquery mobile</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/jsp/">jsp</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mobile/">mobile</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nodejs/">nodejs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/npm/">npm</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/photos/">photos</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/php/">php</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/requirejs/">requirejs</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/seam/">seam</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/svg/">svg</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/threejs/">threejs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ued/">ued</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/w3c标准/">w3c标准</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/web/">web</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/webapp/">webapp</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/webgl/">webgl</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/webpage/">webpage</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/wordpress/">wordpress</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/上下文/">上下文</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/分享/">分享</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/前端/">前端</a><span class="tag-list-count">8</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/前端-Javascript-css-ES6/">前端 Javascript css ES6</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/学习/">学习</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/性能/">性能</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/总结/">总结</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/效率/">效率</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/模块化/">模块化</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/游戏/">游戏</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/理论/">理论</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/生活/">生活</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/社会化网络/">社会化网络</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/移动/">移动</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/移动端开发/">移动端开发</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/算法/">算法</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/编程/">编程</a><span class="tag-list-count">18</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/美女/">美女</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/翻译/">翻译</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/范式/">范式</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/设计模式/">设计模式</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/语义网/">语义网</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/语言/">语言</a><span class="tag-list-count">21</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/资源/">资源</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/转载/">转载</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/面向对象/">面向对象</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/风景/">风景</a><span class="tag-list-count">1</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">标签云 Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/Angularjs/" style="font-size: 10px;">Angularjs</a> <a href="/tags/CSS/" style="font-size: 19.09px;">CSS</a> <a href="/tags/CSS-3/" style="font-size: 13.64px;">CSS 3</a> <a href="/tags/D2/" style="font-size: 10px;">D2</a> <a href="/tags/DIY/" style="font-size: 10px;">DIY</a> <a href="/tags/Design/" style="font-size: 10.91px;">Design</a> <a href="/tags/Structure/" style="font-size: 16.36px;">Structure</a> <a href="/tags/android/" style="font-size: 10px;">android</a> <a href="/tags/app/" style="font-size: 10px;">app</a> <a href="/tags/blog/" style="font-size: 10.91px;">blog</a> <a href="/tags/bug/" style="font-size: 10px;">bug</a> <a href="/tags/css3/" style="font-size: 14.55px;">css3</a> <a href="/tags/debug/" style="font-size: 10px;">debug</a> <a href="/tags/dojo/" style="font-size: 10px;">dojo</a> <a href="/tags/easy-ui/" style="font-size: 10px;">easy ui</a> <a href="/tags/firefox/" style="font-size: 10px;">firefox</a> <a href="/tags/flash/" style="font-size: 10px;">flash</a> <a href="/tags/free-hosting/" style="font-size: 10px;">free hosting</a> <a href="/tags/game/" style="font-size: 10px;">game</a> <a href="/tags/geekTime/" style="font-size: 10px;">geekTime</a> <a href="/tags/html/" style="font-size: 13.64px;">html</a> <a href="/tags/html5/" style="font-size: 18.18px;">html5</a> <a href="/tags/hybrid/" style="font-size: 11.82px;">hybrid</a> <a href="/tags/ie/" style="font-size: 10.91px;">ie</a> <a href="/tags/ios/" style="font-size: 10px;">ios</a> <a href="/tags/java/" style="font-size: 17.27px;">java</a> <a href="/tags/javascript/" style="font-size: 20px;">javascript</a> <a href="/tags/jquery/" style="font-size: 15.45px;">jquery</a> <a href="/tags/jquery-mobile/" style="font-size: 10.91px;">jquery mobile</a> <a href="/tags/jsp/" style="font-size: 10px;">jsp</a> <a href="/tags/mobile/" style="font-size: 10.91px;">mobile</a> <a href="/tags/nodejs/" style="font-size: 10px;">nodejs</a> <a href="/tags/npm/" style="font-size: 10px;">npm</a> <a href="/tags/photos/" style="font-size: 10px;">photos</a> <a href="/tags/php/" style="font-size: 10px;">php</a> <a href="/tags/requirejs/" style="font-size: 10.91px;">requirejs</a> <a href="/tags/seam/" style="font-size: 10.91px;">seam</a> <a href="/tags/svg/" style="font-size: 10px;">svg</a> <a href="/tags/threejs/" style="font-size: 10px;">threejs</a> <a href="/tags/ued/" style="font-size: 10.91px;">ued</a> <a href="/tags/w3c标准/" style="font-size: 12.73px;">w3c标准</a> <a href="/tags/web/" style="font-size: 13.64px;">web</a> <a href="/tags/webapp/" style="font-size: 10.91px;">webapp</a> <a href="/tags/webgl/" style="font-size: 10px;">webgl</a> <a href="/tags/webpage/" style="font-size: 10.91px;">webpage</a> <a href="/tags/wordpress/" style="font-size: 11.82px;">wordpress</a> <a href="/tags/上下文/" style="font-size: 10px;">上下文</a> <a href="/tags/分享/" style="font-size: 10.91px;">分享</a> <a href="/tags/前端/" style="font-size: 16.36px;">前端</a> <a href="/tags/前端-Javascript-css-ES6/" style="font-size: 10px;">前端 Javascript css ES6</a> <a href="/tags/学习/" style="font-size: 10px;">学习</a> <a href="/tags/性能/" style="font-size: 12.73px;">性能</a> <a href="/tags/总结/" style="font-size: 10.91px;">总结</a> <a href="/tags/效率/" style="font-size: 11.82px;">效率</a> <a href="/tags/模块化/" style="font-size: 10.91px;">模块化</a> <a href="/tags/游戏/" style="font-size: 11.82px;">游戏</a> <a href="/tags/理论/" style="font-size: 14.55px;">理论</a> <a href="/tags/生活/" style="font-size: 10.91px;">生活</a> <a href="/tags/社会化网络/" style="font-size: 10.91px;">社会化网络</a> <a href="/tags/移动/" style="font-size: 10px;">移动</a> <a href="/tags/移动端开发/" style="font-size: 10px;">移动端开发</a> <a href="/tags/算法/" style="font-size: 13.64px;">算法</a> <a href="/tags/编程/" style="font-size: 18.18px;">编程</a> <a href="/tags/美女/" style="font-size: 10px;">美女</a> <a href="/tags/翻译/" style="font-size: 13.64px;">翻译</a> <a href="/tags/范式/" style="font-size: 12.73px;">范式</a> <a href="/tags/设计模式/" style="font-size: 11.82px;">设计模式</a> <a href="/tags/语义网/" style="font-size: 10px;">语义网</a> <a href="/tags/语言/" style="font-size: 19.09px;">语言</a> <a href="/tags/资源/" style="font-size: 10.91px;">资源</a> <a href="/tags/转载/" style="font-size: 10px;">转载</a> <a href="/tags/面向对象/" style="font-size: 10px;">面向对象</a> <a href="/tags/风景/" style="font-size: 10px;">风景</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">文章 Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/07/">July 2018</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/06/">June 2018</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/08/">August 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/07/">July 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/04/">April 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/03/">March 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/08/">August 2015</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/03/">March 2015</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/12/">December 2014</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/11/">November 2014</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/10/">October 2014</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/05/">May 2014</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/04/">April 2014</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/03/">March 2014</a><span class="archive-list-count">7</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/02/">February 2014</a><span class="archive-list-count">6</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/01/">January 2014</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/12/">December 2013</a><span class="archive-list-count">9</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/11/">November 2013</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/10/">October 2013</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/09/">September 2013</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/08/">August 2013</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/07/">July 2013</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/06/">June 2013</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/05/">May 2013</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/03/">March 2013</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/01/">January 2013</a><span class="archive-list-count">6</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/11/">November 2012</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/08/">August 2012</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/06/">June 2012</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/05/">May 2012</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/04/">April 2012</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/03/">March 2012</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/02/">February 2012</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/01/">January 2012</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/12/">December 2011</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/11/">November 2011</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/10/">October 2011</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/09/">September 2011</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/08/">August 2011</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/07/">July 2011</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/06/">June 2011</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/04/">April 2011</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/02/">February 2011</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2011/01/">January 2011</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/12/">December 2010</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/11/">November 2010</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/10/">October 2010</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/09/">September 2010</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/08/">August 2010</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/06/">June 2010</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/04/">April 2010</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2010/01/">January 2010</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2009/08/">August 2009</a><span class="archive-list-count">1</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">最近 Recents</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2018/07/23/nvm安装问题处理-nvm-is-not-compatible-with-the-npm-config-prefix-option-错误/">nvm安装问题处理 nvm is not compatible with the npm config prefix option 错误</a>
          </li>
        
          <li>
            <a href="/2018/06/06/前端知识体系大全/">前端知识体系大全</a>
          </li>
        
          <li>
            <a href="/2016/08/28/使用Angularjs开发控制台类项目/">使用Angularjs开发控制台类项目</a>
          </li>
        
          <li>
            <a href="/2016/07/11/Apicloud开发app的问题总结/">Apicloud开发app的问题总结</a>
          </li>
        
          <li>
            <a href="/2016/04/25/前端面试经典问题/">前端面试经典问题</a>
          </li>
        
      </ul>
    </div>
  </div>

  
      <div class="widget-wrap">
<h3 class="widget-title">友情链接 Links</h3>
<div class="widget">
<ul>
<li><a href="http://wande.me" title="玩的么" target="_blank">玩的么</a></li>
</ul>
</ul>
</div>
  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2018 宅鱼<br>
      更多游戏： <a href="http://wande.me"  target="_blank">玩的么</a><br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">首页</a>
  
    <a href="/archives" class="mobile-nav-link">文章</a>
  
    <a href="/raincss" class="mobile-nav-link">RainCSS</a>
  
</nav>
    <!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"rainzhai"};
  (function() {
    var ds = document.createElement('script');
    ds.type = 'text/javascript';ds.async = true;
    ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
    ds.charset = 'UTF-8';
    (document.getElementsByTagName('head')[0] 
     || document.getElementsByTagName('body')[0]).appendChild(ds);
  })();
  </script>
<!-- 多说公共JS代码 end -->

<script type="text/javascript" src="http://wandeme.com/js/jquery-1.7.2.min.js"></script>

<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F49ba6eabd43121d820d9120777bdaf30' type='text/javascript'%3E%3C/script%3E"));
</script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>

  </div>
</body>
</html>